package com.glq1218.springsecuritydemo.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glq1218.springsecuritydemo.domain.entity.User;
import com.glq1218.springsecuritydemo.mapper.UserMapper;
import com.glq1218.springsecuritydemo.service.UserService;
import org.springframework.stereotype.Service;

/**
 * (User)表服务实现类
 *
 * @author glq1218
 * @since 2023-02-09 15:19:17
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public User findByUsername(String username) {
        LambdaUpdateWrapper<User> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
        lambdaUpdateWrapper.eq(User::getUsername, username);
        return getOne(lambdaUpdateWrapper);
    }
}